{template 'common/header'}
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/style/main.css">
<script type="text/javascript" src="{MODULE_URL}template/style/main.js"></script>
<ul class="nav  mianbaoxue">
	 {if $_GPC['id']}

	 <a  href="{php echo url('site/entry/banner', array('m' => 'yts_qiye'));}">返回轮播图列表页</a> >>  编辑内容
	 	
	{else}
	<a href="{php echo url('site/entry/banner', array('m' => 'yts_qiye'));}">返回轮播图列表页</a> >> 新增内容
		
	 {/if}
</ul>

<style>
	.mianbaoxue{
		margin-bottom: 10px
	}
	.mianbaoxue a{
		color: #067cf3
	}

</style>

<form id="reply-form" action="" method="post" enctype="multipart/form-data" ng-controller="KeywordReply" class="ng-pristine ng-valid ng-scope">

	<input type="hidden" name="id" value="{$banner_info[id]}">
	<div class="zeng_msgbox_layer_wrap" id="q_Msgbox" style="top:30%;display:block;display:none;">
		<span class="zeng_msgbox_layer" style="z-index:10000" id="mode_tips_v2">
			<span class="gtl_ico_hits"></span>
			<span class="tsmsg"></span>
			<span class="gtl_end"></span>
		</span>
	</div>


	<div class="panel panel-default module-1">
	 
	    <div class="panel-body">

		    <div class="form-group">
			    <label for="firstname" class="col-sm-2 control-label">标题</label>
			    <div class="col-sm-10">
			      <input type="text" name="title" class="form-control" id="title" placeholder="请输入标题" value="{$banner_info[title]}">
			    </div>
			</div>

			<div class="form-group">
				<label for="lastname" class="col-sm-2 control-label">图片位置</label>
				<div class="col-sm-10">
				  
					<div class="radio">
						<label>
							<input type="radio" name="type_position" id="shenhe" value="1" {if $banner_info[ 'type_position'] == 1 OR $banner_info[ 'type_position'] == 0 } checked {/if}>首页
						</label>
						<label>
							<input type="radio" name="type_position" id="shenhe" value="2" {if $banner_info[ 'type_position'] == 2 } checked {/if}>列表页
						</label>
					</div>
				
				</div>
			</div>



			<div class="form-group">
				<label for="lastname" class="col-sm-2 control-label">跳转类型</label>
				<div class="col-sm-10">
				  
					<div class="radio">
						<label>
							<input type="radio" name="type_skip" id="shenhe" value="1" {if $banner_info[ 'type_skip']== 1 OR $banner_info[ 'type_skip'] == 0 } checked {/if}>超链接
						</label>
						<label>
							<input type="radio" name="type_skip" id="shenhe" value="2" {if $banner_info[ 'type_skip']== 2 } checked {/if}>小程序
						</label>
					</div>
					<span class="help-block"><code>小程序内跳转路径 <a onclick="shuoming()" >请点击此处查看</a></code></span>
					
				</div>
			</div>


			<div class="form-group">
					<label for="firstname" class="col-sm-2 control-label">跳转地址</label>
					<div class="col-sm-10">
					  <input type="text" name="url" class="form-control" id="url" placeholder="请输入跳转地址;" value="{$banner_info[url]}">
					</div>
				</div>
	

		   <div class="form-group">
			    <label for="lastname" class="col-sm-2 control-label">图片</label>
			    <div class="col-sm-5">
				{php echo tpl_form_field_image('img_path',$banner_info['img_path']);}
			</div>




	    </div>
	</div>
		<div class="clearfix"></div>
		<div class="form-group reply-post-action we7-margin-top" style="text-align: center;">
			<div class="">
				{if $_GPC['id']}
				<input type="submit" class="btn btn-primary js-editor-submit multi-submit" style="width:200px" value="保存">
				{else}
				<input type="submit" class="btn btn-primary js-editor-submit multi-submit" style="width:200px" value="发布">
				{/if}
			</div>
		</div>


</form>


<script>
	
	$(".fanslist_table").hide();
	var ggposttype = 'add';
	var currentggObj = null;
	
	$("form").eq(0).submit(function(){
		if($("input[name=title]").val()==''){
			return messageBox("请输入标题！");
		}
		if($("input[name=img_path]").val()==''){
			return messageBox("请添加图片！");
		}

		return true;
	})





	function messageBox(msg){

		if($(".zeng_msgbox_layer_wrap").css("display")=="none"){

			$(".zeng_msgbox_layer_wrap").css("display","block");

			$(".zeng_msgbox_layer_wrap .tsmsg").html(msg);


			setTimeout(function(){

				$(".zeng_msgbox_layer_wrap").css("display","none");				


			},2000);

		}

		return false;
	}



</script>

{template 'common/footer'}